package com.spc.car.data.domain.project.po;

import lombok.Data;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.ScriptAssert;

/**
 * @author 12262
 */
@Data
@ScriptAssert(lang = "javascript",
        script = "com.spc.oa.data.domain.project.po.GetProjectTenderingInfoPO.checkField(_this.projectTenderingId, _this.projectTenderingCode)",
        message = "招标项目Id和招标项目编号不能都为空")
public class GetProjectTenderingInfoPO {

    private Long projectTenderingId;

    private String projectTenderingCode;

    public static boolean checkField(Long projectTenderingId, String projectTenderingCode) {

        if (ObjectUtils.isEmpty(projectTenderingId) && StringUtils.isBlank(projectTenderingCode)){
            return false;
        }
        return true;

    }
}
